package com.decent.web.controller;

import com.decent.common.annotation.ParameterModel;
import com.decent.common.bo.SimpleMessage;
import com.decent.web.entity.XssRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class XssProtectDemoController {
    @RequestMapping("normalProtect")
    public SimpleMessage normalProtect(String param) {
        log.info("normalProtect:[{}]", param);
        return SimpleMessage.ok();
    }

    @RequestMapping("beanProtect")
    public SimpleMessage beanProtect(@ParameterModel XssRequest param) {
        log.info("beanProtect:[{}]", param);
        return SimpleMessage.ok();
    }

    @RequestMapping("jsonProtect")
    public SimpleMessage jsonProtect(@RequestBody XssRequest param) {
        log.info("jsonProtect:[{}]", param);
        return SimpleMessage.ok();
    }
}
